


#ifndef JYMacros_h
#define JYMacros_h

#define Screen_Bounds [UIScreen mainScreen].bounds
#define Screen_Height [UIScreen mainScreen].bounds.size.height
#define Screen_Width [UIScreen mainScreen].bounds.size.width


// 客服电话
#define ServicePhone1 @"400-600-6656"
#define ServicePhone2 @"13666668888"


/*----------------------------------URL 相关----------------------------------*/



#define MAIN_URL @"http://api.front.jinyoufarm.com/api"

//元宝
//#define MAIN_URL @"http://api.mgr.jinyoufarm.com/api"


#define  SUCCESS [resposeObject[@"result"] integerValue] == 0

/*----------------------------------账号 相关----------------------------------*/
/****友盟账号配置****/
#define UMACCOUNT @"58c217b0f29d980d850018d3"
#define UMQQ_APPID @"1106056382"
#define UMWX_APPID @"wxdd4a10d4e8c7cac0"
#define UMWX_APPSecret @"3424a3398dd46449a3d02a9160184bdd"
#define UMWB_APPID @"428661569"
#define UMWB_APPSecret @"0295a46581fff961a24e81644546eea1"


/****JPush账号配置****/
#define JPushAppKey @"b816844fc72ea8c7fd6b256a"
#define kAPPSource  @"appstore"





/*----------------------------------function 相关----------------------------------*/
// 设置view圆角
#define kViewRadius(view, radius)\
\
[view.layer setCornerRadius:(radius)];\
[view.layer setMasksToBounds:YES]

//默认占位图片
#define defaultPlaceholderImage [UIImage imageNamed:@"placeholderImage"]
#define defaultFarmImage [UIImage imageNamed:@"home_icon_meat"]
// 系统字体大小定义
#define kFont(F)                                [UIFont systemFontOfSize:F]
//有点问题
//#define kFont(_fontSize_)  [UIFont systemFontOfSize:(_fontSize_ *([UIScreen mainScreen].scale) / 2)]

// RGB转UIColor（不带alpha值）十六进制
#define UIColorFromRGB(rgbValue)                [UIColor  colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0  green:((float)((rgbValue & 0xFF00) >> 8))/255.0  blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

// RGB转UIColor（带alpha值）十六进制
#define UIColorRGBAlpha(rgbValue,a)             [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]

// 用于生成weakSelf
#define WeakSelf(weakSelf)                          __weak typeof(&*self) weakSelf = self;
#define kWeakSelf(type)                             __weak typeof(type) weak##type = type;
#define kStrongSelf(type)                           __strong typeof(type) type = weak##type;

#define JYWeakSelf __weak typeof(self) weakSelf = self


//打印
#if DEBUG
#define NSLog(fmt,...) NSLog((@"%s [Line %d]" fmt),__PRETTY_FUNCTION__,__LINE__,##__VA_ARGS__)
#else
#define NSLog(...)
#endif




#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)


#define SCREEN_MAX_LENGTH (MAX(Screen_Width, Screen_Height))
#define SCREEN_MIN_LENGTH (MIN(Screen_Width, Screen_Height))

#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)

/*----------------------------------color 相关----------------------------------*/
//背景色 浅灰色
//#define kGlobalColor  [UIColor colorWithHexString:@"F2F2F2"]
//背景色
#define kBgColor [UIColor colorWithHexString:@"F2F2F2"]
//主色 浅蓝色  如导航栏、商品按钮
#define kThemeColor   [UIColor colorWithHexString:@"62C6B2"]
//辅色 红色  如价格、删除
#define kRedColor   [UIColor colorWithHexString:@"FB483E"]
//辅色 蓝色 如我的页面图标
#define kBlueColor   [UIColor colorWithHexString:@"39A1ED"]

//文字  黑色 如导航、标题、正文
#define k3Color   [UIColor colorWithHexString:@"333333"]
//文字   浅灰色  如提示、正文
#define k6Color   [UIColor colorWithHexString:@"666666"]
//文字 浅灰色 如提示、正文
#define k9Color   [UIColor colorWithHexString:@"999999"]
//文字  白色
#define kfColor   [UIColor colorWithHexString:@"ffffff"]
//分割线颜色
#define kSeparatedLineColor   [UIColor colorWithHexString:@"DCDDDD"]

//浅灰色
#define kf2Color   [UIColor colorWithHexString:@"F2F2F2"]

/*----------------------------------字号 相关----------------------------------*/

/*----------------------------------常量 相关----------------------------------*/


/*---------------------首页常量----------------------*/

#define leftTableWidth [UIScreen mainScreen].bounds.size.width * 0.21
#define rightTableWidth [UIScreen mainScreen].bounds.size.width * 0.79

#define MJRandomData [NSString stringWithFormat:@"随机数据---%d", arc4random_uniform(100)]
#define  bannerHight 150
#define funHight 164
#define tableViewHeight Screen_Height-funHight-64-10-49
#define scrollViewContentHeight (bannerHight+funHight+10+tableViewHeight)



//banner的高度 200
#define kBannerHeight JYScreen_Height * 0.274
//轮播图显示最大张数
#define BannerPageSize 6
//appid
#define APPID_APPSTORE @"1217675138"
//全局tableView 行高
#define kTableView_rowHeight 44
//全局tableView 文字字体
#define kTableView_textFont 14
//全局按钮高度
#define kGlobalButtonHeight 44

//获取验证码的时间
#define kGlobalGetVaildCodeTime 60
//全局按钮的高度
#define kBtnHeight  44

#endif /* JYMacros_h */
